<template>
  <transition name="popup-fade">
    <div class="popup">
       <div class="popup-warpper">
           <div class="ticket">
                <p>{{text}}</p>
                <slot></slot>
                <div  @click="confirm" class="close">{{confirmBtnText}}</div>
           </div>
       </div>
    </div>
  </transition>
</template>

<script>
  export default {
    props: {
      text: {
        type: String,
        default: ''
      },
      confirmBtnText: {
        type: String,
        default: '关闭'
      }
    }, 
    methods: {       
      confirm() {
        this.$emit('confirm')
      }        
    }    
  }

</script>

<style scoped lang="scss" rel="stylesheet/css">
  @import "~common/scss/variable";

  .popup{
    position: fixed;
    left: 0;
    right: 0;
    top:0;
    bottom: 0;
    z-index: 998;
    background-color:rgba(255, 255, 255, 0.2);
    &.popup-fade-enter-active{
      animation: confirm-fadein 0.3s;     
    }     
    .popup-warpper{
        position: absolute;
        left: 0;
        right: 0;
        bottom: 50px;
        z-index: 999;
        background-color:$color-highlight-background;
    }  
  }
.close {
    text-align: center;
    font-size: 15px;
    color: #dc3a2d;
    height: 50px;
    line-height: 50px;
    border-top: 1px solid #f1f2f4;
}
//弹窗
.ticket > p {
    height: 50px;
    line-height: 50px;
    text-align: center;
    font-size: 15px;
    border-bottom: 1px solid #f1f2f4;
}
  @keyframes popup-fadein{
    0%{
      opacity: 0
    }
    100%{
      opacity: 1
    }

  }
</style>